home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / mylib.arc / MYLIB.ASM next >
Encoding:
Assembly Source File  |  1986-12-31  |  3.9 KB  |  159 lines

  1. ;.............................................................
  2. ;
  3. ;     video.asm is a routine you can call from basic
  4. ;     with the cx,dx,ax,bx registers as integers. The
  5. ;     format is defint a-z, cx = 0 * 256 + 0. The 0
  6. ;     represents the byte regs   ch        cl.
  7. ;
  8. vid_o     segment byte public 'code'
  9.           assume cs:vid_o,ds:nothing,es:nothing
  10. ;
  11.           public   video
  12. video     proc     far
  13.           push     bp
  14.           mov      bp,sp
  15.           mov      bx,[bp+12]
  16.           mov      cx,[bx]
  17.           mov      bx,[bp+10]
  18.           mov      dx,[bx]
  19.           mov      bx,[bp+8]
  20.           mov      ax,[bx]
  21.           mov      bx,[bp+6]
  22.           mov      bx,[bx]
  23.           int      10h
  24. ;
  25.           push     bx
  26.           mov      bx,[bp+12]
  27.           mov      [bx],cx
  28.           mov      bx,[bp+10]
  29.           mov      [bx],dx
  30.           mov      bx,[bp+8]
  31.           mov      [bx],ax
  32.           pop      bx
  33.           mov      dx,bx
  34.           mov      bx,[bp+6]
  35.           mov      [bx],dx
  36. ;
  37.           pop      bp
  38.           ret      8
  39. ;
  40. video     endp
  41. vid_o     ends
  42. ;.............................................................
  43. ;
  44. ;     this is a subroutine called from basic
  45. ;     that save or restores a 4000 char array
  46. ;     to the screen use buff$ = space$(4000)
  47. ;     or something to initialize array
  48. ;     0 = save screen 1 = restore screen
  49. ;
  50. ;
  51. scrn      segment byte public 'code'
  52.           assume cs:scrn,ds:scrn,es:scrn
  53. ;
  54. scrsave   proc    far
  55.           public  scrsave
  56.           push    bp
  57.           mov     bp,sp
  58.           push    ds
  59.           push    es
  60. scr_check:
  61.           mov     ah,15
  62.           int     10h
  63.           mov     cx,0b000h
  64.           mov     dx,03bah
  65.           cmp     al,7
  66.           jz      opt_check
  67.           mov     cx,0b800h
  68.           mov     dx,03dah
  69. opt_check:
  70.           mov     bx,[bp+6]
  71.           mov     ax,[bx]
  72.           mov     bx,[bp+8]
  73.           cmp     al,0
  74.           jne     put_scr
  75. get_scr:
  76.           mov     si,0
  77.           mov     di,[bx+2]
  78.           mov     ds,cx
  79.           jmp     do_it
  80. put_scr:
  81.           mov     si,[bx+2]
  82.           mov     di,0
  83.           mov     es,cx
  84. do_it:
  85.           mov     cx,2000
  86. p1:
  87.           in      al,dx
  88.           test    al,1
  89.           jnz     p1
  90.           cli
  91. p2:
  92.           in      al,dx
  93.           test    al,1
  94.           jz      p2
  95. move:
  96.           movsw
  97.           sti
  98.           loop    move
  99. fini:
  100.           pop     es
  101.           pop     ds
  102.           pop     bp
  103.           ret     4
  104. ;.............................................................
  105. scrsave   endp
  106. scrn      ends
  107. ;
  108. ;
  109. ;     bios.asm is a routine you can call from basic
  110. ;     with the cx,dx,ax,bx registers as integers. The
  111. ;     format is defint a-z, cx = 0 * 256 + 0. The 0
  112. ;     represents the byte regs   ch        cl.
  113. ;
  114. bio_s     segment byte public 'code'
  115.           assume cs:bio_s,ds:nothing,es:nothing
  116. ;
  117.           public   bios
  118. bios      proc     far
  119.           push     bp
  120.           mov      bp,sp
  121.           mov      bx,[bp+12]
  122.           mov      cx,[bx]
  123.           mov      bx,[bp+10]
  124.           mov      dx,[bx]
  125.           mov      bx,[bp+8]
  126.           mov      ax,[bx]
  127.           mov      bx,[bp+6]
  128.           mov      bx,[bx]
  129.           int      21h
  130.           pop      bp
  131.           ret      8
  132. bios     endp
  133. bio_s    ends
  134. ;.............................................................
  135. ;         hold.asm is a routine that will
  136. ;         wait for a key to be struck and
  137. ;         return after the keyboard buffer
  138. ;         has been cleared
  139. ;
  140. hol_d     segment byte public 'code'
  141.           assume cs:hol_d,ds:nothing,es:nothing
  142. ;
  143.           public   hold
  144. hold      proc     far
  145.           push     bp
  146. ;
  147. holdit    macro
  148.           mov      ah,8
  149.           int      21h
  150.           endm
  151. ;
  152.           holdit
  153. ;
  154.           pop      bp
  155.           ret
  156. hold      endp
  157. hol_d     ends
  158.           end
  159.